package com.uwlaser.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.uwlaser.base.CommonModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
* @author zk-Qin
* @date 2022-05-11
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("device_main")
public class FactoryDeviceMain extends CommonModel<FactoryDeviceMain> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "设备编码")
    @NotBlank
    private String deviceCode;

    @ApiModelProperty(value = "设备名称")
    @NotBlank
    private String deviceName;

    @ApiModelProperty(value = "设备类别")
    @NotBlank
    private String deviceType;

    @ApiModelProperty(value = "设备型号")
    @NotBlank
    private String deviceModel;

    @ApiModelProperty(value = "产线编码")
    @NotBlank
    private String lineCode;

    @ApiModelProperty(value = "工段编码")
    @NotBlank
    private String sectionCode;

    @ApiModelProperty(value = "工位代码")
    @NotBlank
    private String stationCode;

    @ApiModelProperty(value = "是否接收工单")
    @NotBlank
    private String receiveOrder;

    @ApiModelProperty(value = "是否监控")
    @NotBlank
    private String monitor;

    @ApiModelProperty(value = "描述")
    private String remark;

    @ApiModelProperty(value = "创建人")
    @TableField(fill= FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "图片")
    private String picture;

    @ApiModelProperty(value = "序列号")
    private String serialNumber;

    @ApiModelProperty(value = "使用状态")
    private String useState;

    @ApiModelProperty(value = "负责人")
    private String responsibleUser;

    @ApiModelProperty(value = "品牌")
    private String brand;

    @ApiModelProperty(value = "设备等级")
    private String deviceGrade;

    @ApiModelProperty(value = "所属部门")
    private String department;

    @ApiModelProperty(value = "摆放位置")
    private String place;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "供应商")
    private String supplier;

    @ApiModelProperty(value = "购置日期")
    private String purchaseData;

    @ApiModelProperty(value = "保修期至")
    private String warrantyData;

    @ApiModelProperty(value = "启用日期")
    private String commissioningDate;

    @ApiModelProperty(value = "预计报废日期")
    private String expectedObsolescenceDate;

    @ApiModelProperty(value = "设备来源")
    private String deviceSource;

    @ApiModelProperty(value = "技术参数")
    private String technicalSpecification;

    @ApiModelProperty(value = "在线状态")
    private String isOnline;

    @ApiModelProperty(value = "运行状态")
    private String deviceStatus;

    @ApiModelProperty(value = "报警代码")
    private String alarmCode;

    public void copyFrom(FactoryDeviceMain source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
